<h1>View Vehicle "<?php echo $vehicle?>"</h1>

<table>
  <tbody>
    <tr>
      <th>Owner: </th>
      <td><?php echo link_to($vehicle->getTaxpayer()." (".$vehicle["taxpayer_id"].")","taxpayer/show?id=".$vehicle["taxpayer_id"])?></td>
    </tr>
    <tr>
      <th>Plate: </th>
      <td><?php echo $vehicle["plate"]?></td>
    </tr>
    <tr>
      <th>Model: </th>
      <td><?php echo $vehicle["model"]?></td>
    </tr>
    <tr>
      <th>Registration: </th>
      <td><?php echo $vehicle["registration"]?></td>
    </tr>
    <tr>
      <th></th>
      <td><?php echo link_to("Edit","vehicle/edit?id=".$vehicle["id"])?></td>
    </tr>
    <tr>
      <th></th>
      <td><?php echo link_to("Delete","vehicle/delete?id=".$vehicle["id"],array('method'=>'delete','confirm'=>"are you sure?"))?></td>
    </tr>
    <tr>
      <th></th>
      <td><?php echo link_to("Add Receipt","receipt/new?vehicle_id=".$vehicle["id"])?></td>
    </tr>
    <tr>
      <th></th>
      <td><?php echo link_to("Return to Taxpayer","taxpayer/show?id=".$vehicle["taxpayer_id"])?></td>
    </tr>
  </tbody>
</table>

<hr>
Receipts:
<table>
  <thead>
    <tr>
      <th></th>
      <th> | </th>
      <th></th>
      <th> | </th>
      <th>Year</th>
      <th> | </th>
      <th>Amount Paid</th>
      <th> | </th>
      <th>OR</th>
      <th> | </th>
      <th>Date</th>
      <th> | </th>
      <th>Gov Permit</th>
      <th> | </th>
      <th>Collector</th>
    </tr>
  </thead>
  <tbody>
    <?php foreach ($vehicle->getReceipts() as $receipt): ?>
    <tr>
      <td><?php echo link_to("Show","receipt/show?id=".$receipt["id"])?></td>
      <td> | </td>
      <td><?php echo link_to("Edit","receipt/edit?id=".$receipt["id"])?></td>
      <td> | </td>
      <td><?php echo $receipt->getYear()?></td>
      <td> | </td>
      <td align=right><?php echo MyDecimal::format($receipt["amount_paid"])?></td>
      <td> | </td>
      <td><?php echo link_to($receipt["o_r"],"receipt/show?id=".$receipt["id"])?></td>
      <td> | </td>
      <td><?php echo $receipt["date"]?></td>
      <td> | </td>
      <td align=right><?php echo MyDecimal::format($receipt["gov_permit"])?></td>
      <td> | </td>
      <td><?php echo $receipt->getCollector()?></td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>

